<?php

namespace app\adminapi\validate;

use app\common\validate\BaseValidate;

class SysRoleMenuValidate extends BaseValidate
{
    protected $rule = [
        'id' => 'require|number',
        'roleId' => 'require|number',
        'menuIds' => 'require'
    ];

    protected $message = [
        'id.require' => '角色菜单参数不完整',
        'roleId.number' => '角色ID类型错误',
        'roleCode.require' => '请选择角色',
        'menuIds.require' => '请为角色分配菜单'
    ];

    protected $scene = [
        'insert' => ['roleId', 'menuIds'],
        'update' => ['id', 'roleId', 'menuIds'],
        'query' => ['roleId']
    ];
}